/**
 * 是否微信
 * @return boolean
 */
export function isWeChat() {
  const ua = navigator.userAgent.toLowerCase()
  return ua.includes('micromessenger')
}

/**
 * 是否微信或QQ
 * @return boolean
 */
export function isWechatOrQQ() {
  const ua = navigator.userAgent.toLowerCase()
  if (
    ua.includes('micromessenger')
    || ua.includes('weibo')
  ) {
    return true
  }
  else if (ua.includes('mobile mqqbrowser')) {
    return true
  }
  else if (ua.includes('iphone') || ua.includes('mac')) {
    if (ua.includes('qq')) {
      return true
    }
  }
  return false
}
